const MyPromsie = require('./index')
const MyPromise = require('./index')

const p1 = new MyPromise((resolve, reject) => {
  setTimeout(() => {
    // resolve('success')
    reject('fail111')
    // throw 123
  }, 2000)
  // reject('fail111')
})

const p2 = new MyPromise((resolve, reject) => {
  resolve(1)
  // reject('fail')
})


// MyPromsie.all(['a', p1, p2, 'd']).then(console.log, console.log)

// MyPromise.resolve(p1).then(console.log)


p1.finally(v => {
  console.log('fff...', v)
}).then(console.log)